import json

from dubboclient import DubboClient

from api.base_service_api import BaseService


class UserService(BaseService):
    def __init__(self):
        super().__init__()
    def find_by_username(self,username):
        #创建连接对象

        #发送请求
        resp = self.dubbo_client.invoke("UserService", "findByUsername",username)
        #字符串转换成json
        result=json.loads(resp)
        return result

if __name__ == '__main__':
    us=UserService()
    result=us.find_by_username("admin")
    print(result)
    print(type(result))
